package com.yuexunit.operationman.nbsy.module.Placement.model.impl;

import com.yuexunit.operationman.nbsy.Api.Api;
import com.yuexunit.operationman.nbsy.base.SubmitBean;
import com.yuexunit.operationman.nbsy.module.Placement.model.IPlacementModel;
import com.yuexunit.operationman.nbsy.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2017/7/25.
 */
public class PlacementModel implements IPlacementModel {
    Api api;

    public  Api getApiInstance() {
        if(api!=null) {
            return api;
        }else{
            api= ApiUtil.getInstance().createRetrofitApi(Api.class);
            return api;
        }
    }


    @Override
    public Observable<SubmitBean> insertPlacementDate(Map<String, String> praise) {
        api=getApiInstance();
        return api.insertPlacementInfo(praise);
    }

    @Override
    public Observable<SubmitBean> updatePlacementDate(Map<String, String> praise) {
        api=getApiInstance();
        return api.updatePlacementInfo(praise);
    }
}
